﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Common
{
	[Serializable]
	public class ServerMessage
	{
		protected ServerMessageType _type;

		public ServerMessage(ServerMessageType type)
		{
			_type = type;
		}

		public ServerMessageType Type
		{
			get { return _type; }
			set { _type = value; }
		}
	}

	[Serializable]
	public class PlayerTurnServerMessage : ServerMessage
	{
		ChessStep _step;
		Guid _gameId;

		public PlayerTurnServerMessage(ChessStep step, Guid gameId) : base(ServerMessageType.PlayerTurn)
		{
			_step = step;
			_gameId = gameId;
		}

		public ChessStep Step
		{
			get { return _step; }
			set { _step = value; }
		}

		public Guid GameId
		{
			get { return _gameId; }
			set { _gameId = value; }
		}

	}

	[Serializable]
	public class PlayerLostServerMessage : ServerMessage
	{
		string _userName;
		Guid _gameId;

		public PlayerLostServerMessage(string userName, Guid gameId)
			: base(ServerMessageType.PlayerLost)
		{
			_userName = userName;
			_gameId = gameId;
		}

		public string UserName
		{
			get { return _userName; }
			set { _userName = value; }
		}

		public Guid GameId
		{
			get { return _gameId; }
			set { _gameId = value; }
		}
	}
}
